package com.zqh.myfmmall.fallback;

import com.zqh.myfmmall.clients.UserSaveClient;
import com.zqh.myfmmall.result.Result;
import com.zqh.myfmmall.rowbeans.entity.Users;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-03-17 11:20
 */
@Slf4j
public class UserSaveClientFallback implements FallbackFactory<UserSaveClient>{
    @Override
    public UserSaveClient create(Throwable cause) {
        log.warn("" + cause);
        return new UserSaveClient(){
            @Override
            public Result saveUser(Users user) {
                return Result.internalServerError();
            }
        };
    }
}
